package com.learn.elasticsearch.domain;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Mapping;

import java.time.LocalDateTime;


@Data
@Document(indexName = "orders", createIndex = true)
@Mapping(mappingPath = "productIndex.json") // 解决IK分词不能使用问题
public class ProductDocument {
    @Id
    private String id;
    //@Field(analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String productName;
    //@Field(analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String productDesc;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;
}
